package cn.samler.shopapi.Mapper;

import cn.samler.shopapi.Entity.Cart;
import cn.samler.shopapi.Model.Request.Cart.Goods;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    List<Cart> listAll(int uid);

    Cart getCart(@Param("uid") int uid, @Param("gid") int gid, @Param("specToken") String specToken);

    boolean addCart(@Param("uid") int uid, @Param("goods") Goods goods);

    boolean removeCart(@Param("uid") int uid, @Param("goods") Goods goods);

    boolean removeCartByToken(@Param("uid") int uid, @Param("gid") int gid, @Param("specToken") String specToken);

    boolean updateCart(@Param("uid") int uid, @Param("goods") Goods goods);

    boolean clearCart(int uid);

    Integer findGidBySpec(@Param("sid") int sid, @Param("itemId") int itemId);
}
